<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>RabbitMQ Management</title>
    <script src="js/ejs-1.0.min.js" type="text/javascript"></script>
    <script src="js/jquery-3.5.1.min.js"></script>
    <script src="js/jquery.flot-0.8.1.min.js" type="text/javascript"></script>
    <script src="js/jquery.flot-0.8.1.time.min.js" type="text/javascript"></script>
    <script src="js/sammy-0.7.6.min.js" type="text/javascript"></script>
    <script src="js/json2-2016.10.28.js" type="text/javascript"></script>
    <script src="js/base64.js" type="text/javascript"></script>
    <script src="js/global.js" type="text/javascript"></script>
    <script src="js/main.js" type="text/javascript"></script>
    <script src="js/prefs.js" type="text/javascript"></script>
    <script src="js/formatters.js" type="text/javascript"></script>
    <script src="js/charts.js" type="text/javascript"></script>
    <script src="js/singular/singular.js" type="application/javascript"></script>
    
    <link href="css/main.css" rel="stylesheet" type="text/css"/>
    <link href="favicon.ico" rel="shortcut icon" type="image/x-icon"/>
    
    <script type="application/javascript">
      var uaa_logged_in = false;
      var uaa_invalid = false;
      var auth = JSON.parse(sync_get('/auth'));
      enable_uaa = auth.enable_uaa;
      uaa_client_id = auth.uaa_client_id;
      uaa_location = auth.uaa_location;
      if (enable_uaa) {
        Singular.init({
         singularLocation: './js/singular/',
         uaaLocation: uaa_location,
         clientId: uaa_client_id,
         onIdentityChange: function (identity) {
          uaa_logged_in = true;
          start_app_login();
         },
         onLogout: function () {
          uaa_logged_in = false;
          var hash = window.location.hash.substring(1);
          var params = {}
          hash.split('&').map(hk => {
           let temp = hk.split('=');
           params[temp[0]] = temp[1]
          });
          if (params.error) {
           uaa_invalid = true;
           replace_content('login-status', '<p class="warning">' + decodeURIComponent(params.error) + ':' + decodeURIComponent(params.error_description) + '</p> <button id="loginWindow" onclick="uaa_login_window()">Click here to log out</button>');
          } else {
           replace_content('login-status', '<button id="loginWindow" onclick="uaa_login_window()">Click here to log in</button>');
          }
         }
      });
      }
    </script>

<!--[if lte IE 8]>
    <script src="js/excanvas.min.js" type="text/javascript"></script>
    <link href="css/evil.css" rel="stylesheet" type="text/css"/>
<![endif]-->
  </head>

  <body>
    <div id="outer"></div>
    <div id="debug"></div>
    <div id="scratch"></div>
  </body>
</html>
